home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / batchut / batmn21e.zip / BATMAN.DOC next >
Encoding:
Text File  |  1990-12-01  |  24.4 KB  |  837 lines

  1.  
  2.     │
  3.     │ B A T M A N   2 . 1 e
  4.     │
  5.     │ - a batch file
  6.     │   compiler
  7.     │
  8.     │ Thor Ivar Ekle 1989, 90
  9.     │
  10.  
  11.  
  12.  
  13.  
  14.     WHAT IS BATMAN?
  15.     ───────────────
  16.  
  17.     Batman is a utility for compiling batch files, or, in other words,
  18.     translating .BAT-files into .EXE-files. There are two reasons why you
  19.     might to bother with this; first, .EXE-files usually execute much
  20.     faster than .BAT-files. Secondly, batch files are normal text files,
  21.     which means that they can be printed on a screen or printer, whereas
  22.     .EXE-files are unreadable to anyone but a PC. Besides, Batman adds a
  23.     lot of functionality which the DOS batch language lacks.
  24.  
  25.     This version of Batman is free. You may make as many copies as you
  26.     like, and please feel free to give away copies of the program. You may
  27.     not, however, sell part or whole of this package. All distribution of
  28.     Batman is to done by means of the file BATMN21E.ZIP, which shall
  29.     contain these files:
  30.  
  31.         BATMAN.EXE   - the compiler.
  32.         ROBIN.DAT    - data file used by Batman.
  33.         BATMAN.DOC   - this file.
  34.         BATNEWS.TXT  - summary of the latest news in Batman.
  35.         TRACY.EXE    - interactive debugger.
  36.         TRACY.DOC    - documentation for Tracy.
  37.         COLORS.EXE   - utility which displays the available color codes.
  38.         EXCOM.EXE    - utility which reports how external commands are
  39.                        executed.
  40.         GCD.EXE      - utility which displays the directory tree and lets
  41.                        you change the current directory.
  42.         MEXEC.EXE    - utility which lets you select files and pass them as
  43.                        arguments to a specified command.
  44.  
  45.     Should you have any questions regarding Batman, please feel free to
  46.     call me at +47-7-518621.
  47.  
  48.  
  49.  
  50.     USING BATMAN
  51.     ────────────
  52.  
  53.     The command for starting Batman is:
  54.  
  55.         BATMAN [/A] [/C] [/D] <batch file>
  56.  
  57.     The parameter <batch file> is the name of the .BAT-file you wish to
  58.     compile.
  59.  
  60.     Options:
  61.  
  62.         /A:  If there already exists a file by the same name as the
  63.              batch file with the extension .EXE, Batman will normally ask
  64.              you to confirm that it should be replaced before compilation
  65.              starts. Also, the message "Done - press <─┘" is displayed
  66.              after Batman has completed a successful compilation. These two
  67.              messages are omitted if this option is selected. This is
  68.              useful for automatic compilations.
  69.  
  70.         /C:  This option forces Batman to always use COMMAND.COM for
  71.              execution of external commands. See the section "External
  72.              Commands" for more information.
  73.  
  74.         /D:  Use this option if you wish to debug the program file with
  75.              the interactive debugger Tracy. See the documentation for
  76.              Tracy for more information.
  77.  
  78.     You may include a full path in <batch file> if the desired file isn't
  79.     located in the current directory. You may omit the extension ".BAT",
  80.     but other extensions are not accepted. Batman will search for the
  81.     requested file, and display an error message if it can't be found.
  82.  
  83.     If found, a new file with the same name, but with the extension ".EXE"
  84.     will be created. If such a file already exists, you will be asked to
  85.     confirm that it should be overwritten and replaced by the new file. The
  86.     resulting .EXE-file will be stored in the same directory as the
  87.     batch file.
  88.  
  89.     During compilation, the file ROBIN.DAT must be available. This file is
  90.     not required by the compiled program file.
  91.  
  92.     The batch file may contain most DOS commands, plus, of course, Batman's
  93.     internal commands. The internal commands are:
  94.  
  95.  
  96.     BELL
  97.     ────
  98.  
  99.     Produces a beep. Useful for alerting the user when a time-consuming
  100.     task has completed.
  101.  
  102.  
  103.     CALL
  104.     ────
  105.  
  106.     This command is used to execute other compiled batch files. The format
  107.     is:
  108.  
  109.         CALL <filename>
  110.  
  111.     When you compile a batch file which contains CALL-commands, Batman will
  112.     display a list of the referenced batch files after compilation has
  113.     completed. This is to remind you to compile these files as well before
  114.     trying to run the program file.
  115.  
  116.     The procedure for calling uncompiled batch files is described in a
  117.     later section.
  118.  
  119.  
  120.     CLOCK
  121.     ─────
  122.  
  123.     Displays a clock on the screen. Formats:
  124.  
  125.         CLOCK ON <column> <line> <foreground color> <background color>
  126.         CLOCK OFF
  127.  
  128.     The form CLOCK ON displays the current time on the screen in the
  129.     desired location and in the chosen colors. CLOCK OFF stops the clock,
  130.     but does not remove the last displayed time.
  131.  
  132.  
  133.     CLREOL
  134.     ──────
  135.  
  136.     Blanks the current line, starting with the cursor position.
  137.  
  138.  
  139.     CLS
  140.     ───
  141.  
  142.     Blanks the whole screen.
  143.  
  144.  
  145.     COLOR
  146.     ─────
  147.  
  148.     Select the colors in which text is displayed on the screen. Parameters
  149.     are foreground and background colors. The format is:
  150.  
  151.         COLOR <foreground color> <background color>
  152.  
  153.     An example:
  154.  
  155.         color 15 1
  156.  
  157.     This will result in white text on a blue background. These are the valid
  158.     color codes:
  159.  
  160.          0 = Black
  161.          1 = Blue
  162.          2 = Green
  163.          3 = Cyan
  164.          4 = Red
  165.          5 = Magenta
  166.          6 = Brown
  167.          7 = Light gray
  168.          8 = Dark gray
  169.          9 = Light blue
  170.         10 = Light green
  171.         11 = Light cyan
  172.         12 = Light red
  173.         13 = Light magenta
  174.         14 = Yellow
  175.         15 = White
  176.  
  177.     Note that you can only use the colors 0-7 for background colors. In
  178.     order for the COLOR command to work, you must load ANSI.SYS or a
  179.     compatible screen driver.
  180.  
  181.     Use the included utility COLORS to see how the different color codes
  182.     look on your screen.
  183.  
  184.  
  185.     DATESTR
  186.     ───────
  187.  
  188.     Displays the current date on the screen. The format is:
  189.  
  190.         DATESTR <column> <line>
  191.  
  192.     The date is displayed in the format DD.MM.YY, and in the current color.
  193.  
  194.  
  195.     DELAY
  196.     ─────
  197.  
  198.     Pauses the execution of the program for the specified number of
  199.     seconds. The format is:
  200.  
  201.         DELAY <seconds>
  202.  
  203.     This command, for example, will result in a 5-second pause:
  204.  
  205.         delay 5
  206.  
  207.     The parameter can be in the range 0 to 60 seconds.
  208.  
  209.  
  210.     ECHO
  211.     ────
  212.  
  213.     Displays a text string on the screen. Format:
  214.  
  215.         ECHO <text>
  216.  
  217.     The forms ECHO [ON | OFF] are not supported, as Batman never echoes any
  218.     commands anyway.
  219.  
  220.     A blank line can be displayed by echoing just a period:
  221.  
  222.         echo .
  223.  
  224.     This is a common method for displaying blank lines, and is implemented
  225.     is several DOS versions.
  226.  
  227.  
  228.     FOR
  229.     ───
  230.  
  231.     Constructs a loop which allows you to repeat a command for selected
  232.     files. The format is:
  233.  
  234.         FOR <variable> IN (<file specification>) DO <command>
  235.  
  236.     An example:
  237.  
  238.         for %%x in (*.txt) do copy %%x lpt1:
  239.  
  240.     This command will print all files with the extension ".TXT" on the
  241.     printer.
  242.  
  243.  
  244.     GOTO / GOSUB / RETURN
  245.     ─────────────────────
  246.  
  247.     These commands allow you to transfer control to another place in the
  248.     batch file. Formats:
  249.  
  250.         GOTO <label>
  251.         GOSUB <label>
  252.  
  253.     Such jumps can only be made to lines that contain a "label". This is a
  254.     line which starts with a colon, for example:
  255.  
  256.         :label1
  257.  
  258.     Batman distinguishes only between the first 8 characters i label names.
  259.  
  260.     If the jump is made by means of the GOSUB command, you can return to
  261.     the following line with the RETURN command. This is not the case when
  262.     control is transferred with the GOTO command.
  263.  
  264.     GOSUB commands may be nested:
  265.  
  266.         :start
  267.      ┌─ gosub label_1
  268.      │  return        <─┐
  269.      └> :label_1        │
  270.      ┌─ gosub label_2   │
  271.      │  echo Label 1  <┐│
  272.      │  return        ─│┘
  273.      └> :label_2       │
  274.         echo Label 2   │
  275.         return        ─┘
  276.  
  277.     You can nest GOSUB commands in 64 levels.
  278.  
  279.  
  280.     IF
  281.     ──
  282.  
  283.     Logical condition.  Format:
  284.  
  285.         IF [NOT] <condition> <command>
  286.  
  287.     where
  288.  
  289.         <condition> = <text>==<text>        or
  290.                        EXIST <filename>     or
  291.                        ERRORLEVEL <value>
  292.  
  293.     The <command> is executed if the condition is true. All forms are
  294.     supported, included IF NOT, IF EXIST, IF NOT EXIST, IF ERRORLEVEL
  295.     and IF NOT ERRORLEVEL.  An example:
  296.  
  297.         if %1==lpt1: echo Printing to %1
  298.  
  299.  
  300.     INKEY
  301.     ─────
  302.  
  303.     Stops the execution of the program and waits until the user presses a
  304.     key. The response is stored in a variable (%%A - %%Z), and can
  305.     optionally be converted into upper case. A prompt can also be
  306.     displayed. Format:
  307.  
  308.         INKEY [<text>] <variable> [UPPER]
  309.  
  310.     A few examples:
  311.  
  312.         inkey %%s
  313.         inkey Continue? %%s
  314.         inkey "Type Y or N" %%s upper
  315.  
  316.     All three examples stop and wait for the user to press a key. Note
  317.     that if the prompt contains blanks, it must be enclosed in double
  318.     quotes for Batman to interpret it correctly. In the third example the
  319.     response will automatically be converted into upper case before it is
  320.     stored in the variable %%S.
  321.  
  322.  
  323.     INPUT
  324.     ─────
  325.  
  326.     Stops execution of the program and waits for the user to type a string
  327.     of characters and press Return. The response is stored in a variable,
  328.     and can optionally be converted to upper case. A prompt can also be
  329.     displayed. Format:
  330.  
  331.         INPUT [<text>] <variable> [UPPER]
  332.  
  333.     Some examples:
  334.  
  335.         input %%x
  336.         input Filename? %%x
  337.         input "Enter your response: " %%x upper
  338.  
  339.     The user's response may be up to 127 characters in length. Note
  340.     that if the prompt contains blanks, it must be enclosed in double
  341.     quotes. In the last example, the string is converted into upper case.
  342.  
  343.  
  344.     LOOP / ENDLOOP
  345.     ──────────────
  346.  
  347.     These two commands let you execute a group of command a specified
  348.     number of times. Valid formats are:
  349.  
  350.          LOOP <constant>
  351.          LOOP <variable>
  352.  
  353.          ENDLOOP
  354.  
  355.     The first command in the loop is the LOOP command. This requires a
  356.     parameter which specifies how many times the loop is to be executed.
  357.     The loop ends with an ENDLOOP command. An example:
  358.  
  359.         loop 10
  360.         echo Ten times
  361.         endloop
  362.  
  363.     These commands will display the text "Ten times" on the screen ten
  364.     times (clever, no?). Instead of specifying a constant value for the
  365.     number of iterations, you can also use a variable. Here's an example:
  366.  
  367.         set %%a=10
  368.         loop %%a
  369.         echo Line %%a
  370.         endloop
  371.  
  372.     These commands will display this on the screen:
  373.  
  374.         Line 1
  375.         Line 2
  376.            .
  377.            .
  378.            .
  379.         Line 10
  380.  
  381.     Loops can be nested in up to 8 levels.
  382.  
  383.  
  384.     MENU / ITEM / ENDMENU
  385.     ─────────────────────
  386.  
  387.     Menus can be built automatically with Batman. A menu always starts with
  388.     the MENU command, which looks like this:
  389.  
  390.         MENU <title> <column> <line>
  391.  
  392.     The parameters specify the menu's title, and the location of its upper
  393.     left corner. One or more menu selections can then be built with the
  394.     ITEM command:
  395.  
  396.         ITEM <text> <label>
  397.  
  398.     The parameter <text> is the text which is displayed in the menu, and
  399.     <label> is the label to which control will be transferred when the user
  400.     selects this menu item. See the GOTO command for more information on
  401.     labels.
  402.  
  403.     The last line in a menu construct contains the ENDMENU command. Let's
  404.     look at an example:
  405.  
  406.         :start
  407.         menu " Main menu " 10 5
  408.         item "1. WordPerfect" wp
  409.         item "2. Exit" done
  410.         endmenu
  411.         :wp
  412.         wp.exe
  413.         goto start
  414.         :done
  415.  
  416.     These commands will display the following menu on column 10, line 5:
  417.  
  418.         ┌ Menu ──────────┐
  419.         │ 1. WordPerfect │
  420.         │ 2. Exit        │
  421.         │                │
  422.         │ Select: _      │
  423.         └────────────────┘
  424.  
  425.     The user can press "1" or "2" in order to jump to the associated
  426.     labels.
  427.  
  428.  
  429.     PATH
  430.     ────
  431.  
  432.     Sets DOS' search path.  Format:
  433.  
  434.         PATH=<directory>[;<directory>]
  435.  
  436.     See your DOS manual for more information about the search path.
  437.  
  438.  
  439.     PAUSE
  440.     ─────
  441.  
  442.     Displays a message on the screen and waits for the user to press a key.
  443.     The format is:
  444.  
  445.         PAUSE [<text>]
  446.  
  447.     If you don't specify a message, the standard message "Press any key..."
  448.     will be displayed. You can prevent a message from being displayed in
  449.     this way:
  450.  
  451.         pause >nul
  452.  
  453.     This redirects the standard message to the NUL: device.
  454.  
  455.  
  456.     PROMPT
  457.     ──────
  458.  
  459.     Sets the DOS prompt. Format:
  460.  
  461.         PROMPT <text>
  462.  
  463.     See you DOS manual for more information about the DOS prompt.
  464.  
  465.  
  466.     QUIT
  467.     ────
  468.  
  469.     Terminates the program. You can optionally specify a return code
  470.     (errorlevel) in the range 0 to 255. Format:
  471.  
  472.         QUIT [<errorlevel>]
  473.  
  474.     If the program is called by a batch file or another Batman program,
  475.     this return code can be read by the calling program through the
  476.     variable ERRORLEVEL. An example:
  477.  
  478.         The file TEST.BAT:
  479.  
  480.         call test2
  481.         if errorlevel 1 echo The user responded yes
  482.  
  483.         The file TEST2.BAT:
  484.  
  485.         inkey "Answer Yes or No: " %%s
  486.         if %%s==N quit
  487.         if %%s==Y quit 1
  488.  
  489.     The command QUIT without parameters is equivalent to QUIT 0.
  490.  
  491.  
  492.     SET
  493.     ───
  494.  
  495.     Sets DOS' environment variables. Format:
  496.  
  497.         SET <variable>=[<value>]
  498.  
  499.     Examples of such variables are PATH and COMSPEC. You can also set
  500.     Batman's variables (%%A - %%Z) with this command.
  501.  
  502.     If no value is specified, the variable is reset. See the DOS manual for
  503.     further information.
  504.  
  505.  
  506.     SHIFT
  507.     ─────
  508.  
  509.     Moves the program's parameters "to the left".  If, for instance, you
  510.     have this batch file:
  511.  
  512.         :start
  513.         if "%1"=="" goto done
  514.         copy %1 lpt1:
  515.         shift
  516.         goto start
  517.         :done
  518.  
  519.     and run it with the parameters FIL1 and FIL2, the parameter %1 will
  520.     contains "FIL1" the first time the IF command is executed, and "FIL2"
  521.     the second time.
  522.  
  523.  
  524.     XY
  525.     ──
  526.  
  527.     This command places the cursor on a specified position on the screen.
  528.     The format is:
  529.  
  530.         XY <column> <line>
  531.  
  532.     An example:
  533.  
  534.         xy 5 10
  535.  
  536.     This moves the cursor to column 5, line 10. Only constants can be used
  537.     for specifying cursor positions, not variables.
  538.  
  539.  
  540.  
  541.     VARIABLES
  542.     ─────────
  543.  
  544.     When you run a program compiled with Batman, up to 9 parameters can be
  545.     included in the command. These are stored in the variables %1 to %9. An
  546.     example:
  547.  
  548.         prtfiles customer.dat product.dat
  549.  
  550.     This command starts the program PRTFILES.EXE, and sets the variables to
  551.     these values:
  552.  
  553.         %1 = customer.dat
  554.         %2 = product.dat
  555.  
  556.     If you are using DOS version 3.0 or higher, the variable %0 will
  557.     contain the name of the running program; PRTFILES.EXE in this case.
  558.  
  559.     You can also use the internal variables %%A to %%Z. These are among
  560.     other things useful in FOR commands. Please note that an environment
  561.     variable by the same name is created whenever you use an internal
  562.     variable. An example:
  563.  
  564.         input %%a
  565.  
  566.     If the user responds "Gotham", two things will happen: the variable %%A
  567.     will be set to "Gotham", and an environment variable which looks like
  568.     this will be created:
  569.  
  570.         A=Gotham
  571.  
  572.     Environment variables can be referenced by typing a percent sign before
  573.     and after the variable name, for example:
  574.  
  575.         echo %path%
  576.  
  577.     Undefined variables return an empty string.
  578.  
  579.  
  580.  
  581.     EXTERNAL COMMANDS
  582.     ─────────────────
  583.  
  584.     External commands are all other commands than those described in the
  585.     preceding sections.
  586.  
  587.     This section contains a somewhat technical discussion, so here's a
  588.     brief summary for those of you who prefer English to Latin.
  589.  
  590.     If you are experiencing problems with commands other than those
  591.     described above, try one of these solutions:
  592.  
  593.     - Try compiling the program with the /C option. If still no luck:
  594.  
  595.     - Change all external commands (i.e. commands not described above) by
  596.       inserting the environment variable COMSPEC plus the parameter /C at
  597.       the beginning of the lines. As an example, let's look at a command
  598.       for starting WordPerfect:
  599.  
  600.           wp
  601.  
  602.       This should be changed to:
  603.  
  604.           %comspec% /c wp.exe
  605.  
  606.       If you're still having problems:
  607.  
  608.     - Type SET and press Return at the DOS command line. You will see a
  609.       list of the so-called environment variables on the screen. One of
  610.       these is called COMSPEC. Write down what it says behind the equal
  611.       sign (usually something like C:\DOS\COMMAND.COM). Then insert this
  612.       plus the parameter /C at the beginning of all external commands in
  613.       your batch file. Let's look at the WordPerfect example again:
  614.  
  615.           wp
  616.  
  617.       This should be changed to:
  618.  
  619.           c:\dos\command.com /c wp.exe
  620.  
  621.       This example assumes that the WordPerfect program is located in a
  622.       directory which is included in the PATH variable. If this is not the
  623.       case, add the name of your WordPerfect directory also. If your copy
  624.       of WordPerfect is stored in the directory C:\WP, the command should
  625.       look like this:
  626.  
  627.           c:\dos\command.com /c c:\wp\wp.exe
  628.  
  629.       Make sure that the original batch file works the way it should before
  630.       you attempt to compile it.
  631.  
  632.  
  633.     The remainder of this section is devoted to a more technical discussion
  634.     on the use of external commands.
  635.  
  636.     There are two types of external commands in Batman: those who are
  637.     separate programs like for instance WordPerfect and the DOS program
  638.     FORMAT, and those that are internal DOS commands, like DIR and TYPE. If
  639.     you find it confusing that internal DOS commands are external commands,
  640.     this is simply because Batman has to ask DOS to execute them, which
  641.     means that they are external to Batman.
  642.  
  643.     If you specify an external command in the .BAT-file, Batman will first
  644.     check whether it's one of DOS' internal commands. If this is not the
  645.     case, Batman (or, rather, the compiled program) will search for an
  646.     executable file with the extension .COM or .EXE. The search is
  647.     conducted in the current directory and in the directories listed in the
  648.     PATH variable. If no file is found, the message "Unknown command" will
  649.     be issued.
  650.  
  651.     Commands that are internal to DOS must be executed by DOS. These are:
  652.  
  653.         BREAK   CHCP    CHDIR   CD      COPY    CTTY
  654.         DATE    DEL     DIR     ERASE   MKDIR   MD
  655.         RENAME  REN     RMDIR   RD      TIME    TYPE
  656.         VER     VERIFY  VOL
  657.  
  658.     Batman programs use two different ways of execute external commands.
  659.     The safest, but slowest method is by loading a copy of COMMAND.COM and
  660.     letting it execute the command. Normally, Batman programs will attempt
  661.     to avoid this, and use a faster method instead. This method is reliable
  662.     in most versions of DOS, but should you encounter problems with the
  663.     execution of external commands, you can force Batman to use COMMAND.COM
  664.     by compiling with the /C option.
  665.  
  666.     If external commands are executed by loading a secondary copy of
  667.     COMMAND.COM, either because of it's automatically selected or because
  668.     the program is compiled with the /C option, performance can be improved
  669.     by creating a RAM disk and copying COMMAND.COM onto it. You must also
  670.     remember to change the COMSPEC variable:
  671.  
  672.         COPY COMMAND.COM D:\
  673.         SET COMSPEC=D:\COMMAND.COM
  674.  
  675.     This will lead to faster execution of all external commands.
  676.  
  677.     The utility EXCOM reports which method Batman will use, and where
  678.     COMMAND.COM will be loaded from.
  679.  
  680.     Some programs require the use of COMMAND.COM; one example of this is
  681.     the DOS program DISKCOPY. This problem can be solved by specifying
  682.     COMSPEC or COMMAND.COM as part of the command:
  683.  
  684.         %comspec% /c diskcopy a: b:
  685.  
  686.     or:
  687.  
  688.         command /c diskcopy a: b:
  689.  
  690.     Note that the /C parameter must be included.
  691.  
  692.     Users of 4DOS and other similar systems should of course replace
  693.     COMMAND.COM with the appropriate commands. An example of an 4DOS
  694.     command that needs special treatment is LIST, which is not found in
  695.     DOS:
  696.  
  697.         4dos /c list %1
  698.  
  699.     This command should also work if you use the COMSPEC variable, which
  700.     may make your program more foolproof:
  701.  
  702.         %comspec% /c list %1
  703.  
  704.     Since loading a secondary copy of the command processor is slower and
  705.     consumes more memory, you should use it only when necessary.
  706.  
  707.  
  708.  
  709.     CALLING OTHER BATCH FILES
  710.     ─────────────────────────
  711.  
  712.     If you wish to run batch files that are not compiled, this must be done
  713.     by DOS, i.e. you must use one of these methods:
  714.  
  715.         %comspec% /c <batch file>
  716.         command /c <batch file>
  717.  
  718.     See also the previous section and the description of the CALL command.
  719.  
  720.  
  721.  
  722.     ERROR MESSAGES
  723.     ──────────────
  724.  
  725.     There are a few limitations as to what batch files Batman can handle.
  726.     You cannot have than 255 different labels; then you will receive this
  727.     message:
  728.  
  729.         Too many labels
  730.  
  731.     and Batman will abort. Also, you cannot have more than 255 references
  732.     to labels that further down than the GOTO or GOSUB commands. That will
  733.     lead to this message:
  734.  
  735.         Too many references to undefined labels
  736.  
  737.  
  738.     All labels that are referenced by GOTO or GOSUB commands must of course
  739.     be defined somewhere in the file, or you will receive this message:
  740.  
  741.         Undefined label: <name>
  742.  
  743.     These limitations should not mean any difference.
  744.  
  745.     Compilation of very big batch files may result in this message:
  746.  
  747.         Too much code
  748.  
  749.     This means that the file is too big for Batman to process, but this is
  750.     very unlikely. If you try to run Batman with too little memory
  751.     available, you will see this message:
  752.  
  753.         Not enough memory
  754.  
  755.     If you specify invalid parameters for the XY command, you will get this
  756.     message:
  757.  
  758.         Invalid XY parameter
  759.  
  760.     If you try to use invalid variable names in the INKEY command, Batman
  761.     will issue this message:
  762.  
  763.         Invalid INKEY variable
  764.  
  765.     If the sequence of the MENU, ITEM and ENDMENU commands is wrong, you
  766.     will see one of these messages:
  767.  
  768.         ITEM outside MENU
  769.         ENDMENU without MENU
  770.         Invalid command in MENU
  771.  
  772.     Invalid parameters for the COLOR command, i.e. foreground colors
  773.     outside the range 0-15 or background colors outside the range 0-7 will
  774.     result in this message:
  775.  
  776.         Invalid color code
  777.  
  778.     The LOOP command can use either a variable (%%A - %%Z) or a constant as
  779.     argument. If you try to use something else, or if the variable or
  780.     constant is non-numeric, this is how Batman will respond:
  781.  
  782.         Invalid LOOP variable
  783.  
  784.     More than 8 nested LOOP commands will result in this message:
  785.  
  786.         Too many LOOP levels
  787.  
  788.     If you have fewer ENDLOOPs that LOOPs, Batman will say to you:
  789.  
  790.         ENDLOOP without LOOP
  791.  
  792.     Batman only performs limited error checking, so don't try to compile a
  793.     file until you know it's correct. Test it properly first.
  794.  
  795.  
  796.  
  797.     FINAL WORDS
  798.     ───────────
  799.  
  800.     I hope you find Batman useful. Suggestions for improvements and bug
  801.     reports are welcomed.
  802.  
  803.  
  804.  
  805.     APPENDIX A. LIST OF COMMANDS
  806.     ────────────────────────────
  807.  
  808.         BELL
  809.         CALL    <filename>
  810.         CLOCK   OFF | ON <column> <line> <foreground color> <background color>
  811.         CLREOL
  812.         CLS
  813.         COLOR   <foreground color> <background color>
  814.         DATESTR <column> <line>
  815.         DELAY   <seconds>
  816.         ECHO    <text>
  817.         ENDLOOP
  818.         ENDMENU
  819.         FOR     <variable> IN (<file specification>) DO <command>
  820.         GOSUB   <label>
  821.         GOTO    <label>
  822.         IF      [NOT] <condition> | EXIST <filename> | ERRORLEVEL <command>
  823.         INKEY   [<text>] <variable> [UPPER]
  824.         INPUT   [<text>] <variable> [UPPER]
  825.         ITEM    <text> <label>
  826.         LOOP    <constant> | <variable>
  827.         MENU    <title> <column> <line>
  828.         PATH    <search path>
  829.         PAUSE   [<text>]
  830.         PROMPT  <text>
  831.         QUIT    [<errorlevel>]
  832.         RETURN
  833.         SET     <environment variable>=<text>
  834.         SHIFT
  835.         XY      <column> <line>
  836.  
  837.